//
//  DVIGeometry.h
//  DrawShape
//
//  Created by apple on 15/8/5.
//  Copyright (c) 2015年 戴维营教育. All rights reserved.
//

#ifndef DrawShape_DVIGeometry_h
#define DrawShape_DVIGeometry_h

#import <Foundation/Foundation.h>

typedef struct {
    double x;
    double y;
} DVIPoint;

typedef struct {
    double width;
    double height;
} DVISize;

typedef struct {
    DVIPoint origin;
    DVISize  size;
} DVIRect;

extern const DVIPoint DVIPointZero;
extern const DVISize  DVISizeZero;
extern const DVIRect  DVIRectZero;

static inline DVIPoint DVIPointMake(double x, double y) {
    DVIPoint point;
    point.x = x;
    point.y = y;
    return point;
}

static inline DVISize DVISizeMake(double width, double height) {
    DVISize size;
    size.width = width;
    size.height = height;
    return size;
}

static inline DVIRect DVIRectMake(double x, double y, double width, double height) {
    DVIRect rect;
    rect.origin.x = x;
    rect.origin.y = y;
    rect.size.width = width;
    rect.size.height = height;
    
    return rect;
}

NSString * NSStringFromDVIPoint(DVIPoint point);
NSString * NSStringFromDVISize(DVISize size);
NSString * NSStringFromDVIRect(DVIRect rect);
#endif
